Object of class DateTime could not be converted to string

120

// Must convert from DateTime to String
$tempDate = DateTime::createFromFormat('j-M-Y', '15-Feb-2009');
echo $tempDate->format('Y-m-d H:i:s');
// NOT echo $tempDate!!!

Comments

Submit
0 Comments